#include<iostream>
#include<vector>

using namespace std;

int main(){
	int n, len;
	cin>>n>>len;
	vector<int> inDegrees(n + 1);
    vector<int> outDegrees(n + 1);
	for(int i=0;i<len;i++){
		int x, y;
		cin>>x>>y;
		++inDegrees[y];
        ++outDegrees[x];
	}

    for (int i = 1; i <= n; ++i) {
        if (inDegrees[i] == n - 1 && outDegrees[i] == 0) {
            cout<<i;
            return 0;
        }
    }
    cout<<-1;

    return 0;
} 
